@include('Home.head')
<body>
<div class="container" id="app">
    @include('Home.member.header')
    <div class="my-nav-bar">
    	<ol class="am-breadcrumb">
          <li><a href="/home/member/index">首页</a></li>
          <li><a href="">订单</a></li>
        </ol>
    </div>
    <div class="am-cf cart-panel">
        {{--<ul class="flow-default" id="LAY_demo1"></ul>--}}
    	<div id="LAY_demo1" class="withdrawals-panel" v-for="val in order">
            <p class="groupby-t-p">订单号：@{{ val.ordersn }}</p>
            <hr  class="am-divider am-divider-default am-cf"/>
            <div class="groupby-img-panle"><a href="#"><img src="/img/home/user/img3.jpg" class="am-img-responsive" /></a></div>
            <div class="groupby-info-panle">
                <h3><a href="#">@{{ val.ordername }}</a></h3>
                <p>总额：<span class="red2 bold">@{{ val.price }}</span> 元 &nbsp; &nbsp;&nbsp;  积分：<span class="am-text-success">20</span></p>
                <p>商家：新世界 &nbsp; &nbsp; &nbsp;&nbsp;   数量：1</p>
                <p>
                    状态：
                    <span class="red2" v-show="val.status == -1">订单取消</span>
                    <span class="red2" v-show="val.status == 0">待付款</span>
                    <span class="am-text-success" v-show="val.status == 1">已付款</span>
                    <span class="am-text-success" v-show="val.status == 2">已发货</span>
                    <span v-show="val.status == 3">订单完成</span>
                </p>
                <p>下单时间：@{{ val.createtime }}</p>
                <p>
                    <a v-on:click="pay(val.id)" v-show="val.status == 0" class="am-btn am-btn-primary am-btn-xs am-btn-success am-radius">立即支付</a>
                    <a href="#" v-show="val.status == 1 || val.status == 2" class="am-btn am-btn-secondary am-btn-xs am-btn-success am-radius">确定收货</a>
                    <a href="#" v-show="val.status == 3" class="am-btn am-btn-default am-btn-xs am-radius">订单完成</a>
                    <a href="#" class="am-btn am-btn-primary am-btn-xs am-btn-danger am-radius">订单详情</a>
                </p>
            </div>
        </div>
    </div>
    @include('Home.foot')
</div>
</body>
<script src="{{ URL::asset('js/admin/layui/layui.js') }}"></script>
<script>
    layui.use('flow', function(){
        var flow = layui.flow;

        flow.load({
            elem: '#LAY_demo1' //流加载容器
            // ,scrollElem: '#LAY_demo1' //滚动条所在元素，一般不用填，此处只是演示需要。
            ,done: function(page, next){ //执行下一页的回调

                //模拟数据插入
                setTimeout(function(){
                    var lis = [];
                    for(var i = 0; i < 8; i++){
                        lis.push('<li>'+ ( (page-1)*8 + i + 1 ) +'</li>')
                    }

                    //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
                    //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
                    next(lis.join(''), page < 10); //假设总页数为 10
                }, 500);
            }
        });
    });
</script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            title: '我的订单',
            order:{

            },
        },
        methods: {
            //初始化 系统管理员列表
            initialize: function () {
                $.post("/home/member/myorder", {'_token': '{{csrf_token()}}',class:'select'}, function (res) {
                    if (res.code) {
                        app.order = res.data
                    } else {
                        layer.msg(res.data);
                    }
                });
            },
            pay:function (id) {
                window.location.href="/home/straightShop/order?id="+id;
            }
        },
        //自动执行
        mounted: function () {
            this.initialize();
        },
    })
</script>
</html>
